<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>登陆</title>

    <link href="/static/admin/adminex/css/style.css" rel="stylesheet">
	<script src="/static/admin/js/jquery.min.js"></script>
    <script src="/static/admin/layer/layer.js"></script>
    
	
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="/static/admin/adminex/js/html5shiv.js"></script>
    <script src="/static/admin/adminex/js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="login-body">

<div class="container">

    <form class="form-signin"  action="#" method="post" name="signin" id="signin" onSubmit="return submit_form()">
        <div class="form-signin-heading text-center">
            <h1 class="sign-title">登陆</h1>
            <img src="/static/admin/adminex/images/login-logo.png" alt=""/>
        </div>
        <div class="login-wrap">
            <input type="text" class="form-control" name="username" placeholder="用户名" autofocus>
            <input type="password" class="form-control" name="password" placeholder="密码">

            <button class="btn btn-lg btn-login btn-block" type="submit">
                <i class="fa fa-check"></i>
            </button>

            
            <label class="checkbox">
                
                <span class="pull-right">
                    <a data-toggle="modal" href="#myModal"> 忘记密码？</a>

                </span>
            </label>

        </div>

        <!-- Modal -->
        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">忘记密码了？</h4>
                    </div>
                    <div class="modal-body">
                        <p>请输入注册邮箱重新设置密码</p>
                        <input type="text" name="email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix">

                    </div>
                    <div class="modal-footer">
                        <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
                        <button class="btn btn-primary" type="button">提交</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- modal -->

    </form>

</div>



<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->



<script type="text/javascript">
	
	function submit_form(){
			if('' == $("input[name='username']").val())
			{
				layer.tips('请填写用户名', "input[name='username']");
				return false;
			}
			if('' == $("input[name='password']").val())
			{
				layer.tips('请填写密码', "input[name='password']");
				return false;
			}
			
			$.ajax({
			type:'post',
			url:'signin',
			data:$('#signin').serialize(),
			success:function(data){
				if(data.errno > 0)
				{
					layer.msg(data.errmsg);
				}else
				{
					//跳转
					location.href = '../index/index';
				}
			},
			error:function(){layer.msg('数据传输错误！', {icon: 5});},
			
			});
			return false;
	}
</script>

</body>
</html>
